<template>
	<view>
		<!-- 标题栏和状态栏占位符 -->
		<!-- <view class="titleNview-placing"> </view> -->
		<view class="home-header" :style="'background: '+mbgColor+';'">
			<!-- <view class="home-mendian  flex alcenter space plr15 cl-w9">
				<navigator style="width: calc(100% - 80rpx);" url="/sub_pages/scenicArea/ss">
					<view class="flex alcenter" style="width: calc(100% - 80rpx);">
						<text class="iconfont  iconicon_location02 ft14 mr10"></text>
						<text class="text-over ft14 " style="width: calc(100% - 60rpx); color: #000000;">请输入搜索内容</text>
					</view>
				</navigator>
				<text @click="saoma()" class="iconfont iconicon_saoma ft24"></text>
			</view> -->
			<view class="">
				<home-banner :banners="banners"></home-banner>
			</view>
		</view>
		<view class="integral-mall-main plr15" style="margin-top: 0upx;">
			<!-- <view class="integal-mall-menu flex pt16 pb16">
				<view class="col2 text-center bd-left" @click="linkTo" data-link="/sub_pages/scenicArea/info?id=3">
					<view>
						<image style="width: 60rpx; height: 60rpx;" :src="require('@/static/3.png')"></image>
						
					</view>
					<view class="ft14 ftw600 mt6">太行山大峡谷</view>
				</view>
				<view class="col2 text-center bd-left" @click="linkTo" data-link="/sub_pages/scenicArea/info?id=2">
					<view>
						<image style="width: 60rpx; height: 60rpx;" :src="require('@/static/2.png')"></image>
						
					</view>
					<view class="ft14 ftw600 mt6">中国文字博物馆</view>
				</view>
				<view class="col2 text-center" @click="linkTo" data-link="/sub_pages/scenicArea/info?id=1">
					<view>
						<image style="width: 60rpx; height: 60rpx;" :src="require('@/static/1.png')"></image>
					</view>
					<view class="ft14 ftw600 mt6">殷墟博物馆</view>
				</view>
				<view class="col2 text-center bd-left" @click="linkTo" data-link="/sub_pages/scenicArea/info?id=7">
					<view>
						<image style="width: 60rpx; height: 60rpx;" :src="require('@/static/4.png')"></image>
						
					</view>
					<view class="ft14 ftw600 mt6">岳飞庙</view>
				</view>
			</view> -->
		</view> 
		<home-default :datasa="datasa"></home-default> 
		<!-- <com-footer model="index"></com-footer> -->
	</view>
</template>
<script>
	export default {
		data() {
			return {
				navLock: false,
				datasa: [],
				showdyxx: true,
				dataconfig: [],
				banners: [],
				datainfo: [],
				dataindex: [],
				mbgColor: this.$mbgColor,
			}
		},
		computed: {

		},
		onPageScroll(e) {
			if (e.scrollTop > 44) {
				if (this.navLock == false) {
					this.navLock = true;
					uni.setNavigationBarColor({
						frontColor: "#000000",
						backgroundColor: "#FFFFFF",
						complete: () => {
							this.navLock = false;
						}
					});
				}
			} else {
				if (this.navLock == false) {
					this.navLock = true;
					let this_ = this
					uni.setNavigationBarColor({
						frontColor: "#ffffff",
						backgroundColor: this_.mbgColor,
						complete: () => {
							this.navLock = false;
						}
					});
				}
			}
		},
		onShareAppMessage(e) {

		},
		onShareTimeline(e) {

		},
		onLoad(e) {

			//this.getList();
		},
		onShow() {
			this.getRecommendList();
			this.getBannerList();
			let this_ = this

		},
		methods: {
			// lx 类型
			getRecommendList() {
				let this_ = this
				let data = {};
				var limit = 3;
				data.pageSize = limit
				uni.request({
					url: this.configs.webUrl + '/api/scenicArea/list',
					data: data,
					success: data => {
						console.log("111")
						console.log(data.data)
						
						// this.banners = data.data.rows
			


						if (data.data.total > 0) {
							this.datasa = data.data.rows
						}
					},
					fail: (data, code) => {}
				});
			},
			getBannerList() {
				let this_ = this
				let data = {};
				var limit = 3;
				data.pageSize = limit
				uni.request({
					url: this.configs.webUrl + '/api/banner/list',
					data: data,
					success: data => {
						console.log("222")
						console.log(data.data)
						
						this.banners = data.data.rows
			
			
			
					},
					fail: (data, code) => {}
				});
			},
			saoma() {
				//#ifdef APP-PLUS  
				uni.scanCode({
					success: function(res) {
						if (res.result.indexOf("uid") != -1) {
							var obj = JSON.parse(res.result);
							if (obj.uid) {
								uni.navigateTo({
									url: '/pages/login/reg?uid=' + obj.uid
								})
							}
						} else {
							uni.showToast({
								title: res.result,
								icon: "none"
							});
						}
					}
				});
				//#endif

			},
			detail(id) {
				uni.navigateTo({
					url: '/sub_pages/scenicArea/info?id=' + id
				})
			},
			linkTo(e) {
				if (this.isLogin == false) {
					this.showLogin = true;
				} else {
					let link = e.currentTarget.dataset.link;
					uni.navigateTo({
						url: link
					})
				}
			},

			exchange(e) {
				if (this.isLogin == false) {
					this.showLogin = true;
				} else {
					let id = e.currentTarget.dataset.id;
					uni.navigateTo({
						url: '/pages/client/integral/exchange?id=' + id
					})
				}
			},
		},
	}
</script>

<style>
	.home-header {
		height: 600rpx;
		width: 100%;
		position: relative;
		border-radius: 0rpx 0rpx 48rpx 48rpx;
	}

	.home-main {
		width: 100%;
		position: relative;
		margin-top: -156rpx;
		padding: 0 30rpx;
	}

	.home-mendian {
		width: 100%;
		height: 84rpx;
		background: rgba(208, 208, 208, 0.5);
		border-radius: 42rpx;
	}

	.integral-mall-header {
		position: relative;
		height: 320rpx;
	}

	.integral-mall-header .bg {
		width: 100%;
		height: 320rpx;
	}

	.integral-mall-header .main {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 320rpx;
	}

	.swiper-integral {
		height: 32rpx;
		width: 100%;
	}

	.integral-mall-main {
		position: relative;
		/* margin-top: -104rpx; */
	}

	.integal-mall-menu {
		width: 100%;
		height: 176rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
	}

	.integral-tuan-l {
		width: 240rpx;
		height: 180rpx;
		background: #f2f2f2;
		border-radius: 16rpx;
	}


	.integral-mall-coupon {
		height: 408rpx;
		width: 330rpx;
		background: #FFFFFF;
		position: relative;
		border-radius: 16rpx;
		overflow: hidden;
	}

	.integral-mall-coupon .top {
		padding: 0rpx 0rpx 24rpx 0rpx;
		border-bottom: 2rpx dashed #FEC675;
	}

	.integral-mall-coupon .y-l,
	.integral-mall-coupon .y-r {
		width: 20rpx;
		height: 20rpx;
		border-radius: 10rpx;
		background: #F5F6FA;
		position: absolute;
		z-index: 2;
		top: 284rpx;
	}

	.integral-mall-coupon .y-l {
		left: -10rpx;
	}

	.integral-mall-coupon .y-r {
		right: -10rpx;
	}

	.integral-mall-coupon .coupon-value {
		width: 100%;
		height: 250rpx;
		position: relative;
	}

	.integral-mall-coupon .coupon-value image {
		width: 100%;
		height: 180rpx;
	}

	.integral-mall-coupon .coupon-value .num {
		width: 100%;
		height: 64rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		position: absolute;
		left: 0;
		top: 0;
	}

	.integral-mall-goods {
		width: 100%;
		height: 200rpx;
		background: #F2F2F2;
		border-radius: 16upx;
	}

	.titleNview-placing {
		height: var(--status-bar-height);
		padding-top: 44px;
		box-sizing: content-box;
	}
</style>